/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package recommender.objects;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
 *
 * @author Aya
 */
@javax.persistence.Entity
public class User implements Serializable{
    
    private static final long serialVersionUID = 1L;
    
    @Id
    @Column(name="id")
    int id;
    @Column(name="name")
    String name;
    @Column(name="username")
    String username;
    @Column(name="password")
    String password;
    @Column(name="country")
    String country;
    @Column(name="dob")
    @Temporal(TemporalType.DATE)
    Date dob;
    
    List<Video> likeList;
    List<Video> dislikeList;
    List<Entity> explicitInterests;
    List<Entity> explicitDislikes;
    
    Preference preferences;
    Context ctx;
    
    public User(){
        likeList = new ArrayList<>();
        explicitInterests = new ArrayList<>();
        explicitDislikes = new ArrayList<>();
    }
    
    public int getId(){
        return id;
    }
    
    public void like(Video v){
        likeList.add(v);
    }
    
    public void dislike(Video v){
        dislikeList.add(v);
    }
    
    public void expressInterest(Entity e){
        explicitInterests.add(e);
    }
    
    public void expressDislike(Entity e){
        explicitDislikes.add(e);
    }

    public List<Video> getLikeList() {
        return likeList;
    }
    
    public List<Video> getDislikeList() {
        return dislikeList;
    }

    public List<Entity> getExplicitInterests() {
        return explicitInterests;
    }

    public List<Entity> getExplicitDislikes() {
        return explicitDislikes;
    }

    public void setLikeList(List<Video> likeList) {
        this.likeList = likeList;
    }

    public void setDislikeList(List<Video> dislikeList) {
        this.dislikeList = dislikeList;
    }

    public void setExplicitInterests(List<Entity> explicitInterests) {
        this.explicitInterests = explicitInterests;
    }

    public void setExplicitDislikes(List<Entity> explicitDislikes) {
        this.explicitDislikes = explicitDislikes;
    }

    public Preference getPreferences() {
        return preferences;
    }

    public void setPreferences(Preference preferences) {
        this.preferences = preferences;
    }

    public void setCurActiveContext(Context curActiveContext) {
        this.ctx = curActiveContext;
    }
    
    public int getCtx(){
        return this.ctx.getId();
    }
}
